package com.smartcommunity.service.village;

import com.smartcommunity.bean.entity.User;
import com.smartcommunity.bean.model.Pager;
import com.smartcommunity.bean.model.Result;
import com.smartcommunity.entity.people.dto.AddRealPowerDto;
import com.smartcommunity.entity.people.dto.UpdateRealPowerDto;
import com.smartcommunity.entity.village.RealPowerOrg;
import com.smartcommunity.exception.BusinessException;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;

/**
 * @author heweiwei
 * @date 2018/7/16
 */
public interface RealPowerOrgService {
    /**
     * 批量入库实有力量统计
     * @param realPowerOrgs 实有力量统计列表
     */
    void addRealPowers(List<RealPowerOrg> realPowerOrgs);

    /**
     * 添加或修改实有力量
     * @param realPowerOrg
     */
    void addOrUpdateRealPower(RealPowerOrg realPowerOrg);

    /**
     * 根据指定的组织机构id查询该组织机构下的所有小区实有力量统计
     * @param param 请求参数
     * @return 实有力量统计
     */
    Pager<Object> getRealPowerStatisticsByParam(Map<String, Object> param);

    /**
     * 获取实有力量记录总数
     * @return 记录数
     */
    Integer getRealPowerOrgCount();
    Integer getRealPowerCount();

    Object updateRealPower(List json, User user);

    Result queryRealPower(Map<String, Object> param, int pageNum, int pageSize);

    Result getRealPower(String id);

    @Transactional(value = "mysqlTransactionManager", rollbackFor = {BusinessException.class})
    Result insertRealPower(AddRealPowerDto addRealPowerDto);

    @Transactional(value = "mysqlTransactionManager", rollbackFor = {BusinessException.class})
    Result updateRealPower(UpdateRealPowerDto updateRealPowerDto);

    @Transactional(value = "mysqlTransactionManager", rollbackFor = {BusinessException.class})
    Result deleteRealPower(String ids);

}
